<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class LinkRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'title' => 'required',
            'url' => 'required|url',
        ];
    }
    public function messages()
    {
        return [
            'title.required' => '请填写链接标题',
            'url.required' => '请填写链接地址',
            'url.url' => '链接地址格式不正确',
        ];
    }
}
